const cattles = require("../../sql/cattles")
const sql = require('../../sql/mysql');
const drugsrecords = require("../../sql/drugsrecords")
const uuid = require('uuid');
module.exports =  (req,res)=>{

  

   sql.get(cattles).then(data=>{
    req.fields.id = data.length +1;
    sql.add(cattles,req.fields).then(()=>{
          res.send({
              code:0,
              msg:"添加成功"
          })
      }).catch(()=>{
        res.send(
          {
            code:1,
            msg:"添加失败"
          }
        )
      }) 
   })
 
}